/*
 * edb_type.h - EnCluster Base DB type-related definitions
 * Clunix, glory@clunix.com, yjlee@clunix.com, 2001.7.19.
 * Clunix, cezanne@clunix.com, 2005.3
 *
 * $Id: edb_type.h,v 1.1.1.1.10.1 2008/01/15 00:12:25 cezanne Exp $
 *
 * Copyright (c) 2001,2002,2003 by Clunix Inc. All Rights Reserved.
 */

#ifndef EDB_TYPE_H
#define EDB_TYPE_H

/* version: v0-v1-v2 -> (v0 << 16) + (v1 << 8) + (v2 << 0) */
#define EDB_VERSION				0x000500

#ifdef __cplusplus
extern "C" {
#endif

ECM_EXPIMP srt_t	ST_EDBFIELD;
ECM_EXPIMP srt_t	ST_ATTR_UPDATE;
ECM_EXPIMP srt_t	ST_ATTR_FETCH;
ECM_EXPIMP srt_t	ST_ATTR_SYSTEM;
ECM_EXPIMP srt_t	ST_RUN;
ECM_EXPIMP srt_t	ST_STATUS;
ECM_EXPIMP srt_t	ST_MODE;
ECM_EXPIMP srt_t	ST_TIME;
ECM_EXPIMP srt_t	ST_XID;
ECM_EXPIMP srt_t	ST_OWNER;
ECM_EXPIMP srt_t	ST_PATH;
ECM_EXPIMP srt_t	ST_FILE;
ECM_EXPIMP srt_t	ST_MFILE;
ECM_EXPIMP srt_t	ST_DIMAGE;
ECM_EXPIMP srt_t	ST_PERM;

#define ST_ATTR_UPDATE_NONE		0
#define ST_ATTR_UPDATE_PRIVATE		1
#define ST_ATTR_UPDATE_SHARED		2
#define ST_ATTR_UPDATE_INSTANT		3

#define ST_ATTR_FETCH_NONE		0
#define ST_ATTR_FETCH_NORMAL		1
#define ST_ATTR_FETCH_ONDEMAND		2
#define ST_ATTR_FETCH_INSTANT		3

#define ST_STATUS_UNKNOWN		0
#define ST_STATUS_DOWN			1
#define ST_STATUS_UP			2
#define ST_STATUS_PARTIAL		3
#define ST_STATUS_PAUSED		4

#define ST_RUN_STOP			0
#define ST_RUN_START			1
#define ST_RUN_RESTART			2
#define ST_RUN_PAUSE			3

#define EDB_STATUS_UNKNOWN		0
#define EDB_STATUS_DOWN			1
#define EDB_STATUS_UP			2
#define EDB_STATUS_PARTIAL		3
#define EDB_STATUS_SUSPEND		4
#define EDB_STATUS_GOINGDOWN		5

#define EDB_USER_READ			0100
#define EDB_USER_WRITE			0200
#define EDB_GROUP_READ			0010
#define EDB_GROUP_WRITE			0020
#define EDB_OTHER_READ			0001
#define EDB_OTHER_WRITE			0002

#define ST_XID_SELF			0x0001
#define ST_XID_MASTER			0x0002
#define ST_XID_CREATOR			0x0004
#define ST_XID_MODIFIER			0x0005
#define ST_XID_ALL			0x0006
#define ST_XID_NORMAL_MASK		0x8000000000000000LL

#define ST_EDBFIELD_NAME		0x0000
#define ST_EDBFIELD_TYPE		0x0001
#define ST_EDBFIELD_VAL			0x0002
#define ST_EDBFIELD_OWNER		0x0003
#define ST_EDBFIELD_ATTR_UPDATE		0x0004
#define ST_EDBFIELD_REACTOR		0x0005

ECMBOOL edb_type_initialize(void);

#ifdef __cplusplus
}
#endif

#endif	/* EDB_TYPE_H */
